#include "stdafx.h"
#include "BattleGround.h"
#include "GroundRand.h"

BatttleGround::BatttleGround()
{
	//pGroundRand = new GroundRand((*this),1000);
}

BatttleGround::~BatttleGround()
{
	delete pGroundRand;pGroundRand = NULL;
}

int BatttleGround::GetBattleRand( int nRoleId /*= -1*/ )
{

}

void BatttleGround::Hit( int nAttackRoleID )
{
	pGroundRand->Rand(nAttackRoleID);
}

void BatttleGround::SynReq( BatttleGround& rBG ,int nRoleID)
{
	pGroundRand->SaveCurrent(nRoleID);
	rBG.Syn(*this,nRoleID);
}

void BatttleGround::Syn( BatttleGround& rBG,int nRoleID )
{
	unsigned int nRandSeed = pGroundRand->GetRandomSeed(nRoleID);
	unsigned int nRandTimes = pGroundRand->GetRandomTimes(nRoleID);
	rBG.SynRsp(nRoleID,nRandSeed,nRandTimes);

}

void BatttleGround::SynRsp( int nRoleID,unsigned int nRandSeed ,unsigned int nRandTimes)
{
	pGroundRand->SynRsp(nRoleID,nRandSeed,nRandTimes);
}